home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Disc to the Future 2
/
Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin
/
MAC
/
THINKC
/
4_0
/
STANDALO
/
BOUNCE_C
/
LINEBOX.H
< prev
Wrap
Text File
|
1991-01-24
|
1KB
|
36 lines
/*
* LineBox.h -- this file describes the LineBox class, which implements a
* 'bouncing' line object. It's initialized with the number of lines to draw and
* a box in the local grafport to draw it in. The actual bouncing line code is
* adapted from "Macintosh Programming Primer" by Dave Mark and Cartwright Reed.
*/
#ifndef _LineBox_
#define _LineBox_
#include <MacTypes.h>
struct LineBox : indirect {
Rect *lines; /* array of lines to draw */
int numlines; /* number of lines in array */
int dtop, dbottom, dleft, dright; /* delta rectangle */
int top, bottom, left, right; /* bounding box (local) */
GrafPtr port; /* GrafPort to draw into */
/* 'Public' methods */
Boolean Init(int, Rect *, GrafPtr); /* returns false if init failed */
void Draw(void); /* redraws the entire box */
void Idle(void); /* advances the line by one & draws it */
void Close(void); /* deallocates the line array */
/* 'Private' methods */
void DrawLine(int); /* draws line number i */
void RandomRect(Rect *); /* randomizes the rectangle passed */
void RecalcLine(int); /* bumps line forward once */
};
/* size of 'border' region for line box */
#define BORDER 1
#endif /* _LineBox_ */